package com.heo.protocol.packet;

import org.apache.log4j.Logger;

public class GetServerListResp extends BasePacket
{
  private int BODY_LENGTH = -1;// 包体长未知

  private static final String PACKET_NAME = "[获取服务器列表应答包]";
  private static Logger log = Logger.getLogger(GetServerListResp.class);
  
  private String serverList = null;

  public GetServerListResp(short sequenceId) throws Exception
  {
    super(PACKET_NAME);
    super.totalLength = (short) (HEAD_LENGTH + BODY_LENGTH);
    super.commandId = DeviceCommand.GET_SERVER_LIST_RESP;
    super.sequenceId = sequenceId;
  }
  
  @Override
  public int getTotalLength()
  {
    return super.HEAD_LENGTH + serverList.length();
  }

  @Override
  public byte[] getPacketBody()
  {
    return serverList.getBytes();
  }

  public static void main(String[] args)
  {

  }

  @Override
  public void makeBody()
  {

  }

  public String getServerList()
  {
    return serverList;
  }

  public void setServerList(String serverList)
  {
    this.serverList = serverList;
  }

}
